package com.ruoyi.system.api.domain.caigou;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.system.api.domain.basedata.Goods;
import com.ruoyi.system.api.domain.store.StockIn;
import com.ruoyi.system.api.domain.store.Warehouse;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 采购退货详情单对象 finer_buy_back_order_detail
 *
 * @author wl
 * @date 2024-10-27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BuyBackOrderDetail implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    private Integer id;

    /**
     * 采购退货单id
     */
    @Excel(name = "采购退货单id")
    private Integer buyBackOrderId;

    /**
     * 采购入库源单id
     */
    @Excel(name = "采购入库源单id")
    private Integer srcStockInId;

    //采购入库单对象
    private StockIn stockIn;

    //采购入库单编码
    @Excel(name = "采购入库单编码")
    private String srcStockInCode;

    /**
     * 商品id
     */
    @Excel(name = "商品id")
    private Integer goodsId;

    //商品对象
    private Goods goods;

    //商品名称
    @Excel(name = "商品名称")
    private String goodsName;

    //商品成本
    @Excel(name = "商品采购成本")
    private BigDecimal buyCost;

    //单位id
    private Integer unitId;

    //商品单位
    @Excel(name = "商品单位")
    private String unitName;

    /**
     * 仓库id
     */
    @Excel(name = "仓库id")
    private Integer houseId;

    //仓库对象
    private Warehouse warehouse;

    //仓库名称
    @Excel(name = "仓库名称")
    private String houseName;

    //采购入库单价
    @Excel(name = "采购入库单价")
    private BigDecimal cost;

    /**
     * 采购退货出库数量
     */
    @Excel(name = "采购退货出库数量")
    private Integer outStock;

    /**
     * 实际退货出库数量
     */
    @Excel(name = "实际退货出库数量")
    private Integer realOutStock;

    /**
     * 采购退货应收款（计算）
     */
    @Excel(name = "采购退货应收款", readConverterExp = "计=算")
    private BigDecimal inPrice;

    /**
     * 实际退货应收款
     */
    @Excel(name = "实际退货应收款")
    private BigDecimal realInPrice;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createDate;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    private String createBy;

    /**
     * 修改人
     */
    @Excel(name = "修改人")
    private String modifyBy;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date modifyDate;

    /**
     * 是否删除（0：未删除1：已删除）
     */
    private Integer isDel;

    //备注
    @Excel(name = "备注")
    private String remark;

    /**
     * 搜索值
     */
    @JsonIgnore
    private String searchValue;

    /**
     * 请求参数
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Map<String, Object> params;

    public Map<String, Object> getParams() {
        if (params == null) {
            params = new HashMap<>();
        }
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }

}
